<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

</body>
<script>
    function isArray(obj){
        if(Object.prototype.toString.call(obj) === '[object Array]')
            return true;

        var length = 'length' in obj && obj.length;
        return typeof length==='number'&& length>=0;
    }
    function map(arr,callback){
        var newArr = [],temp;
        if(isArray(arr)){
            for(var i=0;i<arr.length;i++){
                temp = callback(arr[i],i);
                if(temp!=null){
                    newArr.push(temp);
                }
            }
        }else{
            for(var k in arr){
                temp = callback(arr[k],k)
                if(temp!=null){
                    newArr.push(temp);
                }
            }
        }
        return newArr;
    }

    var obj = [
        { name: 'jim1', age: 19, gender: '男' },
        { name: 'jim2', age: 19, gender: '男' },
        { name: 'jim3', age: 19, gender: '男' },
        { name: 'jim4', age: 19, gender: '男' },
        { name: 'jim5', age: 19, gender: '男' },
        { name: 'jim6', age: 19, gender: '男' }
    ]

    document.body.innerHTML = '<table border="1" width="600"><tbody>'+
            map(obj,function(item){

                return '<tr>'+ map(item,function(v){
                            return '<td>'+v+'</td>';
                        }).join('')+'</tr>';
            }).join('')+'</tbody></table>';
</script>
</html>